package com.chance.cc.crawler.prod.command.trigger.domain.commerce.du;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.commerce.du.DuCommonCrawlerJobScript;
import com.chance.cc.crawler.prod.command.job.domain.commerce.du.product.DuProductDetailNew2CrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-06-22 10:30:11
 * @email okprog@sina.com
 */
public class DuCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {

        publishDuProductSimpleScheduleTriggerInfo(DuProductDetailNew2CrawlerSchedulerJob.crawlerScheduler());
//
//        publishDuProductFindListScheduleTriggerInfo(DuProductFindListCrawlerSchedulerJob.crawlerScheduler());
//        publishDuProductDetailScheduleTriggerInfo(DuProductDetailCrawlerSchedulerJob.crawlerScheduler());


        /*Simple*/
//        publishDuSellCalenderSimpleScheduleTriggerInfo(DuSellCalenderCrawlerSchedulerJob.crawlerScheduler());

//        publishDuProductSimpleScheduleTriggerInfo(DuProductFindListCrawlerSchedulerJob.crawlerScheduler());
//        publishDuProductSimpleScheduleTriggerInfo(DuProductDetailCrawlerSchedulerJob.crawlerScheduler());
//        publishDuProductSimpleScheduleTriggerInfo(DuProductInitFileCrawlerSchedulerJob.crawlerScheduler());

    }

    public static void publishDuProductFindListScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuCommonCrawlerJobScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 13 * * ?",
                "得物商品新品列表每天13:00采集一次");
    }
    public static void publishDuProductDetailScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuCommonCrawlerJobScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 40 0 * * ?",
                "得物全量商品详情每天00:40采集一次");
    }

    public static void publishDuSellCalenderScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuCommonCrawlerJobScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 40 3 * * ?",
                "得物发售日历每天3：40采集一次");
    }

    public static void publishDuProductSimpleScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuCommonCrawlerJobScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "得物商品信息临时采集");
    }

    public static void publishDuSellCalenderSimpleScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuCommonCrawlerJobScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "得物发售日历临时采集");
    }
}
